package com.MedDroid.task;

import android.os.AsyncTask;
import com.MedDroid.MainApp;
import com.MedDroid.control.AuthenticationControl;

import java.lang.ref.WeakReference;

/**
 * Created with IntelliJ IDEA.
 * User: Romen
 * Date: 02/12/13
 * Time: 2:29 PM
 * Description:
 */
public class LogoutTask extends AsyncTask<Void, Void, Boolean>
{
	AuthenticationControl AuthenticationC;

	public LogoutTask(AuthenticationControl Auth)
	{
		AuthenticationC = Auth;
	}

	@Override
	protected Boolean doInBackground(Void... voids)
	{
		return AuthenticationC.attemptLogout();
	}

	@Override
	protected void onPostExecute(Boolean Success)
	{
		if (Success)
		{
			MainApp.log("Logging Out...");
		}
		else
		{
			MainApp.log("Failed to Log Out.");
		}
	}
}
